package com.hqyj.controller;

import com.hqyj.entity.Person;
import com.hqyj.entity.Person2;
import com.hqyj.entity.User;
import com.hqyj.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.RestController;


@RestController
public class UserController {
    @Autowired
    private UserService userService;
    @Autowired
    private Person person;
    @Autowired
    private Person2 person2;

    @Autowired
    private Environment environment;

    @GetMapping("/userQueryAll")
    public Object userQueryAll() {
        return userService.userQueryAll();
    }
    @GetMapping("/personTest")
    public void personTest(){
        System.out.println(person.getName());
        System.out.println(person.getGender());
        System.out.println(person.getAge());
    }
    @GetMapping("/personTest2")
    public void personTest2(){
        System.out.println(person2.getName());
        System.out.println(person2.getGender());
//        System.out.println(environment.getProperty("person2.name2"));
    }
}
